<html>
<head><meta charset="utf-8"><title>limiting simultaneously compiled crates but not cgus · t-cargo · Zulip Chat Archive</title></head>
<h2>Stream: <a href="https://rust-lang.github.io/zulip_archive/stream/246057-t-cargo/index.html">t-cargo</a></h2>
<h3>Topic: <a href="https://rust-lang.github.io/zulip_archive/stream/246057-t-cargo/topic/limiting.20simultaneously.20compiled.20crates.20but.20not.20cgus.html">limiting simultaneously compiled crates but not cgus</a></h3>

<hr>

<base href="https://rust-lang.zulipchat.com">

<head><link href="https://rust-lang.github.io/zulip_archive/style.css" rel="stylesheet"></head>

<a name="208337883"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/246057-t-cargo/topic/limiting%20simultaneously%20compiled%20crates%20but%20not%20cgus/near/208337883" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> matthiaskrgr <a href="https://rust-lang.github.io/zulip_archive/stream/246057-t-cargo/topic/limiting.20simultaneously.20compiled.20crates.20but.20not.20cgus.html#208337883">(Aug 28 2020 at 12:51)</a>:</h4>
<p>Is there a way to have cargo compile only one crate at a time (like -j 1) but still use the full number of codegen units to compile that crate?</p>



<a name="208338177"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/246057-t-cargo/topic/limiting%20simultaneously%20compiled%20crates%20but%20not%20cgus/near/208338177" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> bjorn3 <a href="https://rust-lang.github.io/zulip_archive/stream/246057-t-cargo/topic/limiting.20simultaneously.20compiled.20crates.20but.20not.20cgus.html#208338177">(Aug 28 2020 at 12:54)</a>:</h4>
<p>Rustc and cargo use the same jobserver to limit parallel processes.</p>



<a name="208339374"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/246057-t-cargo/topic/limiting%20simultaneously%20compiled%20crates%20but%20not%20cgus/near/208339374" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> matthiaskrgr <a href="https://rust-lang.github.io/zulip_archive/stream/246057-t-cargo/topic/limiting.20simultaneously.20compiled.20crates.20but.20not.20cgus.html#208339374">(Aug 28 2020 at 13:05)</a>:</h4>
<p>mmh I guess that's a "no"? <span aria-label="sweat smile" class="emoji emoji-1f605" role="img" title="sweat smile">:sweat_smile:</span></p>



<a name="208339578"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/246057-t-cargo/topic/limiting%20simultaneously%20compiled%20crates%20but%20not%20cgus/near/208339578" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> bjorn3 <a href="https://rust-lang.github.io/zulip_archive/stream/246057-t-cargo/topic/limiting.20simultaneously.20compiled.20crates.20but.20not.20cgus.html#208339578">(Aug 28 2020 at 13:07)</a>:</h4>
<p>You may be able to write a wrapper for rustc that unsets the env vars used for jobserver communication. <a href="https://github.com/alexcrichton/jobserver-rs/blob/b9bdabb53f9ef07deafe357d3d9fcb449f1b8687/src/lib.rs#L228-L230">https://github.com/alexcrichton/jobserver-rs/blob/b9bdabb53f9ef07deafe357d3d9fcb449f1b8687/src/lib.rs#L228-L230</a></p>



<a name="208397293"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/246057-t-cargo/topic/limiting%20simultaneously%20compiled%20crates%20but%20not%20cgus/near/208397293" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Josh Triplett <a href="https://rust-lang.github.io/zulip_archive/stream/246057-t-cargo/topic/limiting.20simultaneously.20compiled.20crates.20but.20not.20cgus.html#208397293">(Aug 28 2020 at 21:32)</a>:</h4>
<p><span class="user-mention" data-user-id="217864">@matthiaskrgr</span> Out of curiosity, what's the use case? Memory usage?</p>



<a name="208398695"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/246057-t-cargo/topic/limiting%20simultaneously%20compiled%20crates%20but%20not%20cgus/near/208398695" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/246057-t-cargo/topic/limiting.20simultaneously.20compiled.20crates.20but.20not.20cgus.html#208398695">(Aug 28 2020 at 21:50)</a>:</h4>
<p>I'd be interested if this makes it faster to compile rustc_middle</p>



<hr><p>Last updated: Aug 07 2021 at 22:04 UTC</p>
</html>